package com.acoreful.acf2admin.web.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.util.StopWatch;

import com.acoreful.acf2admin.commons.base.AbstractResourcePreloaderListener;

/**
 * @author WallenHeng
 *
 */
public class ResourcePreloaderListener extends AbstractResourcePreloaderListener {
	private Logger logger = LoggerFactory.getLogger(ResourcePreloaderListener.class);

	@Override
	protected void preload(ApplicationContext applicationContext) {
		StopWatch stopWatch = new StopWatch("ResourcePreloader");
		stopWatch.start("init");
		initDataDict(applicationContext);
		stopWatch.stop();
		logger.info("preload completed in {} ms ", stopWatch.getTotalTimeMillis());
	}

	private void initDataDict(ApplicationContext applicationContext) {
		/*
		 * //DataDictLoader loader =
		 * applicationContext.getBean(DataDictLoader.class); loader.preLoad();
		 */
	}

}